home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -in_the_mag- / reader_requests / mpmorph4x / rexx / edgepoints.mpm next >
Text File  |  1999-12-01  |  2KB  |  83 lines

  1. /* Either calculates the edges of the first 24bit */
  2. /* file and displays, or adds triangles based on  */
  3. /* the edgess                                     */
  4. /* $VER: EdgePoints_MPM 4.4 (23.2.97)
  5.  */
  6.  
  7. /* Lock the gui                                */
  8. LockGui
  9. /* Check points open                            */
  10. options results
  11. GetAttr openpoints var openpoints
  12. options
  13. if (openpoints = "0") then do
  14.     address command 'requestchoice "MPMorph EdgePoints" "Image windows must be open" "OK"'
  15.     UnlockGui
  16.     exit
  17. end
  18. numeric digits 12
  19. options results
  20. GetAttr file1 var file1
  21. GetAttr file2 var file2
  22. GetAttr file241 var file241
  23. GetAttr file242 var file242
  24. GetAttr width var width
  25. GetAttr height var height
  26. GetAttr pubscreen var pubscreen
  27. GetAttr saved var saved
  28. GetAttr hook var hook
  29. options
  30. if (saved = "0") then do
  31.     address command 'requestchoice "MPMorph EdgePoints Error" "File not saved" "OK"'
  32.     UnlockGui
  33.     exit
  34. end
  35. if (file241 = "") then do
  36.     file241 = file1
  37. end
  38. if (file242 = "") then do
  39.     file242 = file2
  40. end
  41. /* parameters for the gui                    */
  42. if pubscreen="" then do
  43.     params = '"'file241'" "'file242'" 'width' 'height' "" 'hook
  44. end
  45. else do
  46.     params = '"'file241'" "'file242'" 'width' 'height' "PUBSCREEN='pubscreen'" 'hook
  47. end
  48.  
  49. /* Display the gui                            */
  50. if pubscreen="" then do
  51.     address command 'MPMorph:RunMPGui MPMorph:gui/EdgePoints.gui to t:EdgePoints.temp help=MPMorph:EdgePoints.guide relmouse params='params
  52. end
  53. else do
  54.     address command 'MPMorph:RunMPGui MPMorph:gui/EdgePoints.gui to t:EdgePoints.temp help=MPMorph:EdgePoints.guide relmouse params='params' pubscreen="'pubscreen'"'
  55. end
  56. /* quit if cancelled                            */
  57. if (rc > 4) then do
  58.     if (rc > 9) then do
  59.         address command 'requestchoice "MPMorph EdgePoints Error" "Failure calling RunMPGui" "OK"'
  60.     end
  61.     UnlockGui
  62.     exit
  63. end
  64. unlockgui
  65. address command 'delete t:temp.mpm'
  66. SetMessage "Edging_Points"
  67. address command 'execute t:EdgePoints.temp'
  68. if (rc = 0) then do
  69.     if exists('t:temp.mpm') then do
  70.         lockgui
  71.         SetMessage "Adding_Points"
  72.         'newpoints force'
  73.         't:temp.mpm'
  74.         'triangulate force'
  75.         UnlockGui
  76.     end
  77. end
  78. else do
  79.     address command 'requestchoice "MPMorph EdgePoints Error" "Failure calling EdgePoints" "OK"'
  80. end
  81. /* the end!                                        */
  82. exit
  83.